﻿@ModelType FiledWikiPageModel
@Code
    Dim SuggestSearch As Boolean = ViewData.ContainsKey("SuggestSearch")
    Dim SideboxFields As List(Of SideboxField) = Model.GetSideboxFields()
End Code


<h1>
    @Model.Title
    @If SuggestSearch AndAlso ViewData("SuggestSearch") <> Model.Title Then
        @<small>(@ViewData("SuggestSearch"))</small>
    End If
</h1>

<ul class="action-menu">
    @If Model.IsCurrentVersion Then
        @<li>@Html.ActionLink("עריכה", "Edit", New With {.page = Model.Title})</li>
    Else
        @<li>@Html.ActionLink("גרסה עדכנית", "FetchExact", New With {.page = Model.Title})</li>
        @<li>@Html.ActionLink("שחזור גרסה", "Edit", New With {.page = Model.Title, .version = Model.GetVersionCode()})</li>
    End If  
    <li>@Html.ActionLink("היסטוריה", "History", New With {.page = Model.Title})</li>
   @If Model.IsCurrentVersion Then
    @<li>@Html.ActionLink("שינוי שם", "Rename", New With {.page = Model.Title})</li>
    @<li>@Html.ActionLink("מחיקה", "Delete", New With {.page = Model.Title})</li>
  End If
    @If SuggestSearch Then
        @<li class="on-end">@Html.ActionLink("חפש " & ViewData("SuggestSearch"), "Search", New With {.page = ViewData("SuggestSearch")})</li>
    End If
</ul>

<div class="container">

    @If SideboxFields.Count > 0 Then
        @<div class="sidebox col-lg-4 col-md-4 col-sm-5 col-xs-12">
         @If Model.IsFavorite Then
            @Html.ActionLink("מועדף", "FetchExact", New With {.page = "מועדפים"}, New With {.class = "favorite-icon", .title = "ערך מועדף"})
         End If
    <table>
        @For Each SideboxField In SideboxFields
            @<tr>
                @If SideboxField.HasFieldText Then
                    @<th>@SideboxField.FieldText</th>
                    @<td>@Html.Raw(SideboxField.GetContent(Html))</td>
                Else
                    @<td colspan="2">@Html.Raw(SideboxField.GetContent(Html))</td>
                End If
            </tr>
        Next
    </table>
</div>
    End If
    @Html.Raw(MarkupTools.ProcessPageHtmlContent(Model.Content, Model, Html))

    @Html.Raw(WikiModel.Instance.CreateTaggedHereList(Model.Names, Model.Title, Html))
</div>

<hr />
<footer>
    <p>@Model.GetFooterText()</p>
</footer>
